package DecoratorPattern;

/**
 * @version: java version 1.8
 * @Author: Zheng
 * @description:
 * @date: 2022-08-14 21:19
 */
public class DecoratorPatternDemo {
    public static void main(String[] args) {
        Shape circle=new Circle();
        ShapeDecorator redCircle=new RedShapeDecorator(new Circle());
        ShapeDecorator redRectangle =new RedShapeDecorator(new Rectangle());

        System.out.println("初始");
        circle.draw();

        System.out.println("添加红色圆");
        redCircle.draw();

        System.out.println("添加红色矩形");
        redRectangle.draw();
    }
}
